home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 December / macformat-031.iso / mac / Shareware City / Developers / CopyBits Demo 3.1 / CopyBits Demo 3.1 ReadMe < prev    next >
Encoding:
Text File  |  1995-09-10  |  8.3 KB  |  132 lines  |  [TEXT/ttxt]

  1. CopyBits Demo 3.1 ReadMe
  2.  
  3. Requires System 7 or later.
  4.  
  5. CopyBits Demo is an example project that gives several examples of using CopyBits to copy pictures both on screen and between offscreen Graphics Worlds and an onscreen window (as well as between GWorlds). It also allows you to experiment with using CopyBits, CopyMask, and CopyDeepMask using different images, masks, and transfer modes. It does all the following things using CopyBits and its variations:
  6.  
  7. 1) Fade an area of the screen to black (using three different methods).
  8. 2) Demonstrates "flickering" regular animation vs. smooth animation.
  9. 3) Fades one image into another.
  10. (and new in v2.0)
  11. 4) "Pixelizes" and "depixelizes" an image (an animation effect where the picture ends up in a very blocky representation of the original).
  12. 5) Blurs an image.
  13. 6) Flips an image horizontally or vertically.
  14. 7) Applies fading effects to the entire screen rather than just part of a window.
  15. (and new in v3.0)
  16. 8) Slides one image onto another from any of the four major directions.
  17. 9) Imposes one image onto another inside a growing circle, or outside a shrinking circle.
  18. 10) Demonstrates several of the techniques on the full screen rather than just part of the window.
  19. 11) Demonstrates font anti-aliasing using CopyBits with the ditherCopy constant added to the transfer mode.
  20.  
  21. All the code and the project file to build the demo app is included (Metrowerks CodeWarrior C). The code is well documented.
  22.  
  23. By the way, using GWorlds does NOT require Color QuickDraw, just System 7 or later. As a result, this app requires System 7 or later to run.
  24.  
  25. This project was written by Kenneth Worley in the hopes of helping other programmers. If you have any questions, concerns, criticisms, bug reports, etc., please e-mail me at KNEworley@aol.com. The project is ©1995. All Rights Reserved.
  26.  
  27. I'm a freelance programmer. Please send me work!
  28.  
  29. Feel free to distribute this project (with all of its accompanying files) freely to anyone or upload it to other BBSs or online services. Please obtain my permission before including the project in a disk or CD for sale. Thanks!
  30.  
  31. Notes:
  32.  
  33. Only known to work well at 256 colors (not tested at higher bit depths).
  34. Works fine with grays instead of colors.
  35.  
  36. 950516
  37.  
  38. Updated to handle "bad disk" insertions properly.
  39. Updated to handle update events in the main dialog by redrawing squares around picture areas.
  40.  
  41. 950518
  42.  
  43. Updated to version 1.5
  44. Fading between images added.
  45. Code cleaned up.
  46. Speed range changed from 1-100 to 0-20.
  47. Changed PICTs (that's right! I used to be a cop!).
  48.  
  49. 950606
  50.  
  51. Updated to version 2.0
  52. Pixelizing added.
  53. Blur added.
  54. Flipping added.
  55. Full screen demo added.
  56. Gave option of 3 different fade-to-black methods.
  57. Switched to my generic support routines to handle alerts, dialog controls, etc.
  58.  
  59. 950628
  60.  
  61. Updated to version 3.0
  62. Slide added.
  63. Aperture effect added.
  64. CopyBits Technical Demo added to allow experimentation with the CopyBits family of routines.
  65.  
  66. 950908
  67.  
  68. Updated to version 3.1
  69. Font antialiasing demo included in CopyBits Technical Demo.
  70.  
  71.  
  72. ************* Instructions for using the demo application *************
  73.  
  74. When the application is opened, you will be presented with a modal dialog box containing a large number of items. The items are grouped into several sections that make their functions more easily understood. The sections include the source picture sections 1 and 2, and the destination section.
  75.  
  76. ===Source picture section 1:===
  77.  
  78. This section contains the picture in the lower-left corner of the dialog. All the buttons above it affect that picture by transferring the image to the destination area in one way or another.
  79.  
  80. The Copy-> button simply copies the image to the destination area.
  81. The Fade-> button fades the image onto the destination.
  82. The Depixelize-> button copies the image to the destination repeatedly. At first, the image is very "rough" and blocky. Every time the image is copied, you can see more detail.
  83. The Slide L, R, T, and B buttons all cause the image to slide onto the destination area from either the left, right, top, or bottom.
  84.  
  85. ===Source picture section 2:===
  86.  
  87. This section works the same as source picture section 1 except that the actions affect picture 2. Instead of the Slide buttons, however, this section includes:
  88.  
  89. The Aperture In and Out buttons cause the image to appear in the destination area either inside a growing circle, or outside a shrinking circle.
  90.  
  91. ===The Destination section===
  92.  
  93. Images are usually copied here in one way or another from either of the two source picture sections. Once there is an image here, any of the buttons above the destination image will affect the image.
  94.  
  95. The Erase button erases the destination area.
  96. The Pixelate button causes the image to become blockier and blockier.
  97. The Blur button blurs the image.
  98. The Flip H and V buttons flips the image either horizontally or vertically.
  99. The Fade To Black buttons will fade the destination image to black. There are three buttons labelled 1, 2, and 3 to demonstrate three different methods of accomplishing the same thing.
  100.  
  101. *********The Effect Speed text box***********
  102.  
  103. This number (between 0 and 20) affects how quickly the effects are performed. For example, it controls how quickly one image fades into another. When pixelating, or depixelating, however, it controls how blocky the image starts or ends at.
  104.  
  105. *********The Full Screen Demo button***********
  106.  
  107. This demonstrates a few of the effects used in the program on the whole screen instead of just inside the window. There is no way to alter the way this demo is performed from within the program. Once it's started, you just have to wait for it to finish. I recommend setting the effect speed to 20.
  108.  
  109. **********The Technical CopyBits Demo***********
  110.  
  111. This opens another modal dialog that really lets you delve into the workings of CopyBits and its variations CopyMask and CopyDeepMask. The dialog contains five source images along the left side which you can choose among using radio buttons. It contains four mask images (including "none") that affect any CopyBits or CopyDeepMask operation. These are in the top center area of the dialog. Four mask regions are also included just underneath the mask images. These affect any CopyMask or CopyDeepMask operation. Choose from among the mask images or regions using the radio buttons underneath them.
  112.  
  113. In the bottom center area of the dialog are radio buttons for selecting any of the transfer modes that are used in a CopyBits or CopyDeepMask operation. At the very bottom are two constants that are added to the transfer mode value if their checkboxes are checked.
  114.  
  115. In the upper right corner of the dialog is the OpColor selector. The OpColor affects the way some of the arithmetic transfer modes work. The lighter the color, the more of the source image is transferred. The OpColor is set using the OpColor() toolbox call.
  116.  
  117. Just below the OpColor is the destination area. This is where images are transferred when a CopyBits or other operation is performed.
  118.  
  119. Below the destination area are four buttons. Each of these actually perform an operation that causes the destination area to change. The Erase button erases the destination area. The other three buttons perform a CopyBits, CopyMask, or CopyDeepMask using the selected source image, mask image, and/or mask region, transfer mode, and OpColor selected.
  120.  
  121. The Done button takes you back to the main CopyBits Demo dialog.
  122.  
  123. **********Anti-aliasing text************
  124.  
  125. You can see a rough demo of anti-aliasing text by selecting the bottom source image which looks like a large letter A. Try copying that image to the destination with no mask image or region and a transfer mode of srcCopy. The letter looks a little jaggy. Now erase the destination area and check the ditherCopy checkBox below the transfer modes. Copy the image again and it looks smooth! Voila!
  126.  
  127. **********Flicker-Free Animation***********
  128.  
  129. While in the main dialog of CopyBits Demo, if you position the mouse over either of the two source pictures, you'll see an animated colored circle that moves with the mouse. When over the left source picture, the circle is animated by repeatedly drawing the picture and then the circle over it. This results in the picture sometimes flickering through the circle. When over the right source picture, the circle is animated by drawing the image and the circle into an offscreen GWorld and copying that image to the dialog using CopyBits. This prevents any flickering.
  130.  
  131. Experiment! and Enjoy!
  132. Ken